#include "Room.hh"
#include <iostream>

Room::Room(std::string desc) : description(desc), north(nullptr), south(nullptr), east(nullptr), west(nullptr) {}

void Room::addItem(Item* item) {
    items.push_back(item);
}

void Room::addEnemy(Character* enemy) {
    enemies.push_back(enemy);
}

void Room::displayContents() const {
    std::cout << "\n=== " << description << " ===\n";
    std::cout << "Items here you can pick up: ";
    if (!items.empty()) {
        for (Item* item : items) {
            std::cout << item->getName() << " ";
        }
        std::cout << "\n";
    } else {
        std::cout << "None\n";
    }
    std::cout << "Enemies here: ";
    std::cout<<"\n";
    if (!enemies.empty()) {
        for (Character* enemy : enemies) {
            std::cout << enemy->getName() << " : "<<enemy->getDescription()<<"\n";
        }
        std::cout << "\n";
    } else {
        std::cout << "None\n";
    }
}

const std::vector<Item*>& Room::getItems () const{
    return items;
}

const std::vector<Character*>& Room::getEnemies()const{
    return enemies;
}

std::vector<Item*>& Room::getItems() {
    return items;
}

std::vector<Character*>& Room::getEnemies() {
    return enemies;
}